package orfeu.engine;

import android.content.Intent;

public class DeathException extends Exception {

	
	public synchronized void stopGame()
	{
		GLView.getGenerator().setRunning(false);
		GLView.getRenderer().drawList.clear();
		GLView.getUpdater().updateList.clear();
		GLView.gameOver.px = 0;
		GLView.gameOver.py = 0;
		GLView.sheIsLostForver.px = 0;
		GLView.sheIsLostForver.py = -100;
		GLView.canEnterHigh = true;
		synchronized (GLView.getRenderer().drawList) {
			GLView.getRenderer().drawList.add(GLView.gameOver);
			GLView.getRenderer().drawList.add(GLView.sheIsLostForver);
			GLView.getRenderer().drawList.notifyAll();
		}
		synchronized (GLView.getUpdater().updateList) {
			GLView.getUpdater().updateList.add(GLView.gameOver);
			GLView.getUpdater().updateList.add(GLView.sheIsLostForver);
			GLView.getUpdater().updateList.notifyAll();
		}
		
		try {
			Thread.sleep(5000);
		} catch (InterruptedException e) {
			e.printStackTrace();
		}
		//Intent highscoreIntent = new Intent(SpriteGameActivity.context,AddHighscore.class);
		//SpriteGameActivity.context.startActivity(highscoreIntent);
		
		System.exit(0);
		
	}
}
